import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './service/flexible.js'
import '@/assets/iconfont/iconfont.css'
import Toast from '@/components/common/Toast.vue'
import AreaSelect from 'vue-area-linkage'
import 'vue-area-linkage/dist/index.css'
Vue.use(AreaSelect)
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')

Vue.component('Toast', Toast)
Vue.prototype.$toast = {
  show: (msg, type = 'info', duration = 3000) => {
    const Constructor = Vue.extend(Toast)
    const instance = new Constructor().$mount()
    document.body.appendChild(instance.$el)
    instance.show(msg, type, duration)
  }
}
